<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>端API</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <style>
        .header {
            width: 94%;
            height: 2.5rem;
            padding: 0.5rem 0.8rem 0.2rem 0.8rem;
            color: #fff;
            line-height: 2.5rem;
            position: fixed;
            top: 0rem;
            background-color: #40cccc;
            font-size: 1.1rem;
        }
        .fl{
          float: left;
        }
        .fr{
          float: right;
        }
        .header_left{
          width: 20%;

        }
        .header_center{
          width: 63%;
        }
        .header_center ul {
            width: 63%;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
        }

        .header_center ul li {
            width: 47%;
            text-align: center;
            float: left;
        }

        .header_center ul li a {
            color: #fff;
            text-decoration: none;
            font-weight: bold;
        }

        #nice {
            border-bottom: 0.2rem solid orange;
        }
        .header_r{
          width: 11%;
          height: 95%;
        }
        .header_r img{
          width: 100%;
          height: 100%;
        }
        .content{
          width: 100%;
          height: 100vh;
          margin-top: 3rem;

          background-color: rgb(200, 200, 200, 0.3);
        }
        .cont_one{
          width: 93%;
          padding: 1rem 0.8rem 0.8rem 0.8rem;
          background-color: #fff;
          margin-bottom: 1rem;
        }
        .cont_top{
          width: 100%;
          height: 4.5rem;
        }
        .cont_p{
          width: 30%;
          height: 3.5rem;
          line-height: 1.5rem;
          margin-left: 0.5rem;
          margin-top: 0.5rem;
        }
        .cont_imgs{
          width: 5%;
          height: 29%;
          margin-top: 1rem;
        }
        .cont_imgs img{
          width: 100%;
          height: 100%;
        }
        .conts_p{
          width: 100%;
          height: 10%;
          padding:0.5rem 0rem;
        }
        .cont_cimg{
          width: 100%;
          flex-wrap: wrap;
          justify-content: space-between;
          display: flex;
        }
        .cimg_img{
          width: 32%;
          margin-top: 0.5rem;
        }
        .cimg_img img{
          width: 100%;
          height: 100%;
        }
        .cont_foot{
          width: 100%;
          height: 1.5rem;
          line-height: 1.5rem;
          padding: 0.5rem 0rem 0rem 0rem;
      }
      .footer_r{
        width:14%;
      }
  .footer_img{
        width: 26%;
        height: 10%;
        margin-left: 0.3rem;
      }
      .footer_img img{
        width: 100%;
        height: 100%;
      }
    </style>
</head>

<body>
    <div class="header">
        <div class="header_left fl" onclick="posting()">
            发帖
        </div>
        <div class="header_center fl">
            <ul>
                <li id="wdqz" onclick="set_frame(0)"><a href="#" id="nice">我的圈子</a></li>
                <li id="rqqz" onclick="set_frame(1)"><a href="#" id="nice">人气推荐</a></li>
            </ul>
        </div>
        <div class="header_r fr">
            <!-- <img src="../image/u38.png" alt=""> -->
        </div>
    </div>
<script type="text/javascript" src="../script/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/common.js"></script>
</body>
<script>
var userinfo = $api.getStorage('userinfo');

apiready = function() {


    api.addEventListener({
        name:'user_login',
        extra:{
            threshold:0
        }
    }, function(ret, err){
            userinfo=$api.getStorage('userinfo');


    });

    api.addEventListener({
        name:'user_register',
        extra:{
            threshold:0
        }
    }, function(ret, err){
            userinfo=$api.getStorage('userinfo');

    });

    api.addEventListener({
        name:'user_out',
        extra:{
            threshold:0
        }
    }, function(ret, err){
            userinfo=$api.getStorage('userinfo');

    });
  // get_banenrlist()//获取banner列表
  // guesslike()//猜你喜欢（无算法）
  // get_cur_list();//获取列表课程（无算法）
  api.addEventListener({
      name:'cir_send',
      extra:{
          threshold:0
      }
  }, function(ret, err){
      if(ret.value.index==0){//今日推荐
        $("#wdqz").children().attr('id','nice')
        $("#rqqz").children().attr('id','1')
      }else{//全部课程
        $("#wdqz").children().attr('id','1')
        $("#rqqz").children().attr('id','nice')
      }
        //alert( JSON.stringify( ret ) );
  });
}

function posting() {
  if(userinfo){
    api.openWin({
        name: 'guang_ft',
        url: './guang_ft.html'
    });
  }else{
    api.openWin({
        name: 'user_login',
        url: './user_login.html',

    });
  }

}
function set_frame(keys) {

  api.setFrameGroupIndex({
      name: 'circle_form',
      index: keys
  });
}
</script>
</html>
